home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / bin / kexec < prev    next >
Encoding:
Text File  |  1990-01-19  |  434 b   |  26 lines

  1. #!/bin/csh
  2. # kexec - recursive execution on the subdirectories
  3. # Usage: kexec command filekey arguments
  4. #
  5. # Note: filekey can be a part of file name.
  6. #    command must be a single word command
  7. #
  8. set allfiles = `ls`
  9. set subfiles = `ls *$2*`
  10. set file =
  11. foreach file ($subfiles)
  12.     if( -f $file) then
  13.         $1 $file $[3-]
  14.     endif
  15. end
  16.  
  17. foreach file ($allfiles)
  18.     if( -d $file) then
  19.         cd $file
  20.         echo cd $file
  21.         kexec $*
  22.         cd ..
  23.         echo ..
  24.     endif
  25. end
  26.